{include file='_header'}
<script type="text/javascript" src="__STATIC__/js/lib/moment.js"></script>
<link rel="stylesheet" href="__STATIC__/components/datetimepicker/jquery.datetimepicker.css">
<link rel="stylesheet" href="__STATIC__/components/daterangepicker/daterangepicker.css">
<style>
    .input-group-sm.daterange .btn {padding: 4px 6px; border-radius: 0;}
    .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
         border: none;
        border-bottom: 1px solid #efefef;
    }
</style>

<div class='page-header'>当前位置：<span class="text-primary">签到/奖励记录 </span></div>

<div class="page-content">
<form action="" method="get" class="form-horizontal" plugins="form">
    <div class="page-toolbar m-b-sm m-t-sm">
        <div class="col-sm-6">
            {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)), false);}
        </div>
        <div class="col-sm-6 pull-right">
            <div class="input-group pull-right" >
                <div class="input-group-select">
                    <select class="form-control"  name="type">
                        <option value="-1" {if $type==-1}selected{/if}>类型</option>
                        <option value="0" {if $type=='0'}selected{/if}>日常签到</option>
                        <option style="display: none;" value="1" {if $type==1}selected{/if}>连签奖励</option>
                        <option style="display: none;" value="2" {if $type==2}selected{/if}>总签奖励</option>
                    </select>
                </div>
                <div class="input-group-select">
                    <select class="form-control"name="searchtime">
                        <option value="" {if empty($searchtime)}selected{/if}>不按日期</option>
                        <option value="1" {if !empty($searchtime)}selected{/if}>搜索日期</option>
                    </select>
                </div>
                <input type="text" class="input-sm form-control" name="keyword" value="{$keyword}" placeholder="请输入昵称/手机号进行搜索"> <span class="input-group-btn">
                <button class="btn btn-primary" type="submit"> 搜索</button> </span>
            </div>
        </div>
    </div>
</form>
{if count($list)>0}
<table class="table table-responsive ">
    <tbody>
        <tr class="trhead">
            <td style="width: 80px;">ID</td>
            <td >用户</td>
            <td >类型</td>
            <td >获得积分</td>
            <td>备注</td>
            <td style="width: 145px;">签到时间</td>
        </tr>
            {foreach name='list' item='item'}
                <tr class="trbody">
                    <td>{$item['id']}</td>
                    <td>
                        <a href="{:url('admin/member/detail', array('id'=>$item['mid']))}" target="_blank" title="{$item['nickname']}">
                            <img class="radius50" src="{:tomedia($item['avatar'])}" style="width:30px; height:30px; padding: 1px; border:1px solid #ccc;" onerror="this.src='../addons/ewei_shopv2/static/images/noface.png'"> {$item['nickname']}
                        </a>
                    </td>
                    <td>
                        {if $item['type']==0}日常签到{elseif $item['type']==1}连签奖励{elseif $item['type']==2}总签奖励{/if}
                    </td>
                    <td><a class="text-primary" href="{:url('admin/finance/credit1', array('keyword'=>$item['nickname']))}" target="_blank">+{$item['credit']}</a></td>
                    <td data-toggle="popover" data-html="true" data-placement="top" data-trigger="hover" data-content="{$item['log']}" data-original-title="" title="">{$item['log']}</td>
                    <td>{:date('Y.m.d H:i:s', $item['time'])}</td>
                </tr>
            {/foreach}
    </tbody>
    <tfoot>
        <tr>
            <td colspan="6" class="text-right">{$pager}</td>
        </tr>
    </tfoot>
</table>
    {else}
    <div class='panel panel-default'>
        <div class='panel-body' style='text-align: center;padding:30px;'>
            未查询到相关记录!
        </div>
    </div>
    {/if}
</div>

{include file='_footer'}
